Add alternate morphing functions to prompt-morph. #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
prompt_morph.py
currently always morphs between each prompt in a linear way. This PR adds some alternate morphing functions in order to spend more/less time at keyframes, depending on the user's preference.Comparison
Here is a series of gifs illustrating the difference. The gifs are stuck together so that the keyframes should always synchronize. The circle and square are the keyframes, the hands (?) generally appear in the middle.
A (red circle|blue square), viewed from the side. Clip art. Steps: 28, Sampler: Euler a, CFG scale: 28.5, Seed: 713180077
From left-to-right: Linear, Sine, S-Parabola, Parabolic, Parabolic Bounce
x/y graphs
Linear
This is the current behavior.
Sine (but secretly Cosine)
Start slow, speed through the middle, then slow again. The difference from
Linear
is barely noticeable, though.S-parabola
Start and end fast, linger in the middle for a bit. NOTE: I am pretty sure there is a proper mathematical name for this, but I don't know it.
Parabolic
Start slow and accelerate. Drop back to zero velocity on every keyframe.
Parabola bounce
Alternate between accelerating and decelerating. If
linear
would cause a ball to move up-down-up at steady velocity,Parabola bounce
would cause it to look like it was bouncing off the ground like a normal ball affected by gravity. In the gifs above, you can see that (4) and (5) are identical from circle to square, but then differ on the subsequent morph.Discussion / Rationale
person with arms up
->person with arms down
. The morphs didn't produce expected movement though.Future work
Sine
function spending more time near the keyframes, and "glossing over" the chaotic parts between keyframes. But it's hardly noticeable. Perhaps I'll revisit this to find a better function to meet that criteria.Deforum
uses?Also also wik
#
will be treated as a comment, and ignored.